Skip to content

Capture browser session video as a named artifact - #2480

Merged
chubes4 merged 1 commit into
mainfrom
feat/browser-probe-video-capture
Sep 3, 2026
Merged

Capture browser session video as a named artifact#2480
chubes4 merged 1 commit into
mainfrom
feat/browser-probe-video-capture

Conversation

@chubes4

@chubes4 chubes4 commented Sep 3, 2026

Copy link
Copy Markdown
Collaborator

Summary

  • add video to the capture set for wordpress.browser-probe and wordpress.browser-actions
  • record the session when video is requested, and adopt the recording as a named video.webm artifact
  • report the recording in the command summary

Why

Browser evidence could show a final screenshot but never the session that produced it. A recording makes an interaction reviewable — what changed, in what order, and what the user would have seen — which is the missing half of before/after UI evidence.

Implementation notes

Two details drove the shape of this change.

Recording is a context-level capability, so wordpress.browser-actions now takes the environment-context path when video is requested rather than a bare page.

Playwright finalizes a recording only when the context closes, and names the file itself. video.saveAs() is not usable here because it needs a live browser connection, and cleanup closes the context and the browser together — it fails with Target page, context or browser has been closed. The recording is therefore staged in its own directory and adopted afterwards through the existing artifact writer, so it inherits manifest entries, hashing, and provenance rather than being written as a loose file.

A recording is only reported in the summary once it has actually been adopted, so a failed capture cannot claim an artifact that is absent.

Verification

tests/browser-actions-video-capture.browser.test.ts, wired as npm run test:browser-video-capture:

  • a capture=video run records a real navigation and click against a local fixture, and produces a non-empty video.webm that the summary reports
  • an unsupported capture value is rejected with a message naming the supported values

Also run:

  • tsc -b --force packages/runtime-core packages/runtime-playground packages/cli — clean
  • tests/browser-actions-navigation-capture.browser.test.ts — 5 passing, no regressions

The first version of this change used video.saveAs() and the test caught it failing, which is why the adoption path exists.

AI assistance

  • AI assistance: Yes
  • Model: OpenAI gpt-5.6-sol
  • Tool: OpenCode
  • Used for: Implementing the capture wiring and artifact adoption, writing the test, and diagnosing the recording lifecycle constraint, under Chris Huber’s direction.

@chubes4
chubes4 merged commit 414a373 into main Sep 3, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant